﻿
@{
    ViewBag.Title = "Cart";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Content/js/jquery_cart.js"></script>
<link href="~/Content/css/checkOut.css" rel="stylesheet" />
<script src="~/Content/js/jquery-1.8.2.min.js"></script>
<div class="cart-box">

    <div class="cart-buzhou">
        <img src="images/cart-move2.jpg" alt="">

    </div>

    <div class="cart">

        <div class="container">
            <div class="checkout-box">
                <form id="checkoutForm" action="" method="post">
                    <div class="checkout-box-bd">
                        <!-- 地址状态 0：默认选择；1：新增地址；2：修改地址 -->
                        <input type="hidden" name="Checkout[addressState]" id="addrState" value="0">
                        <!-- 收货地址 -->
                        <div class="xm-box">
                            <div class="box-hd">
                                <h2 class="title">收货地址</h2>
                                <!---->
                            </div>
                            <div class="box-bd">
                                <div class="clearfix xm-address-list" id="checkoutAddrList">
                                    @foreach (var item in Model)
                                    {
                                        <dl class="item ">
                                            <dt>
                                                <strong class="itemConsignee">@item.Nam</strong>
                                                <span class="itemTag tag">公司</span>
                                            </dt>
                                            <dd>
                                                <p class="tel itemTel">@item.Phone</p>
                                                <p class="itemRegion">@item.Province@item.City@item.District</p>
                                                <p class="itemStreet">@item.Information</p>
                                                <span class="edit-btn J_editAddr">编辑</span>
                                            </dd>
                                            <dd style="display:none">
                                                <input type="radio" name="" class="addressId" value="">
                                            </dd>
                                        </dl>

                                    }
                                </div>
                                <input type="hidden" name="" id="newType" value="common">
                                <input type="hidden" name="" id="newConsignee">
                                <input type="hidden" name="" id="newProvince">
                                <input type="hidden" name="" id="newCity">
                                <input type="hidden" name="" id="newCounty">
                                <input type="hidden" name="" id="newStreet">
                                <input type="hidden" name="" id="newZipcode">
                                <input type="hidden" name="" id="newTel">
                                <input type="hidden" name="" id="newTag">
                                <!--点击弹出新增/收货地址界面start-->
                                <div class="xm-edit-addr-box" id="J_editAddrBox" style="display: none; width: 300px; top: 219px; left: 543px;">
                                    <div class="bd">
                                        <div class="item">
                                            <label>收货人姓名<span>*</span></label>
                                            <input type="text" name="" id="Consignee" class="input" placeholder="收货人姓名" maxlength="15">
                                            <p class="tip-msg tipMsg" style="display: none;"></p>
                                        </div>
                                        <div class="item">
                                            <label>联系电话<span>*</span></label>
                                            <input type="text" name="" class="input" id="Telephone" placeholder="11位手机号">
                                            <p class="tel-modify-tip" id="telModifyTip" style="display: none;"></p>
                                            <p class="tip-msg tipMsg" style="display: none;"></p>
                                        </div>
                                        <div class="item">
                                            <label>地址<span>*</span></label>
                                            <select name="" id="Provinces" class="select-1"><option value="0">省份/自治区</option><option zipcode="0" value="2">北京</option><option zipcode="0" value="3">天津</option><option zipcode="0" value="4">河北</option><option zipcode="0" value="5">山西</option><option zipcode="0" value="6">内蒙古</option><option zipcode="0" value="7">辽宁</option><option zipcode="0" value="8">吉林</option><option zipcode="0" value="9">黑龙江</option><option zipcode="0" value="10">上海</option><option zipcode="0" value="11">江苏</option><option zipcode="0" value="12">浙江</option><option zipcode="0" value="13">安徽</option><option zipcode="0" value="14">福建</option><option zipcode="0" value="15">江西</option><option zipcode="0" value="16">山东</option><option zipcode="0" value="17">河南</option><option zipcode="0" value="18">湖北</option><option zipcode="0" value="19">湖南</option><option zipcode="0" value="20">广东</option><option zipcode="0" value="21">广西</option><option zipcode="0" value="22">海南</option><option zipcode="0" value="23">重庆</option><option zipcode="0" value="24">四川</option><option zipcode="0" value="25">贵州</option><option zipcode="0" value="26">云南</option><option zipcode="0" value="27">西藏</option><option zipcode="0" value="28">陕西</option><option zipcode="0" value="29">甘肃</option><option zipcode="0" value="30">青海</option><option zipcode="0" value="31">宁夏</option><option zipcode="0" value="32">新疆</option></select>
                                            <select name="" id="Citys" class="select-2" disabled=""><option value="0">城市/地区/自治州</option></select>
                                            <select name="" id="Countys" class="select-3" disabled=""><option value="0">区/县</option></select>
                                            <textarea name="" class="input-area" id="Street" placeholder="路名或街道地址，门牌号" style="margin: 0px; height: 61px; width: 232px;"></textarea>
                                            <p class="tip-msg tipMsg" style="display: none;"></p>
                                        </div>
                                        <div class="item">
                                            <label>邮政编码<span>*</span></label>
                                            <input type="text" name="" id="Zipcode" class="input" placeholder="邮政编码" autocomplete="off">
                                            <p class="zipcode-tip" id="zipcodeTip"></p>
                                            <p class="tip-msg tipMsg" style="display: none;"></p>
                                        </div>
                                        <div class="item">
                                            <label>地址标签<span>*</span></label>
                                            <input type="text" name="" id="Tag" class="input" placeholder="地址标签：如&quot;家&quot;、&quot;公司&quot;。限5个字内">
                                            <p class="tip-msg tipMsg" style="display: none;"></p>
                                        </div>
                                    </div>
                                    <div class="ft clearfix">
                                        <button type="button" class="add-button" id="J_editAddrCancel">取消</button>
                                        <button type="button" id="J_editAddrOk" class="add-button">保存</button>
                                    </div>
                                </div>
                                <!--点击弹出新增/收货地址界面end-->
                                <div class="xm-edit-addr-backdrop" id="J_editAddrBackdrop" style="display: none; width: 1662px; height: 2431px;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="checkout-box-ft">
                        <!-- 商品清单 -->
                        <div id="checkoutGoodsList" class="checkout-goods-box">
                            <div class="xm-box">
                                <div class="box-hd">
                                    <h2 class="title" style="border: none;">确认订单信息</h2>
                                </div>
                                <div class="box-bd">

                                    <div class="cart2-order">
                                        <div class="order-title">
                                            <span class="order-name">商品名称</span>
                                            <span class="order-list">
                                                <ul>
                                                    <li>购买价格</li>
                                                    <li>购买数量</li>
                                                    <li>小计（ 元 ）</li>
                                                </ul>
                                            </span>
                                        </div>
                                        <div class="order-count">
                                            <table width="1320" border="0" cellpadding="0" cellspacing="0" bordercolor="#666666">
                                                <tbody>
                                                    <tr style="font-size: 14px;">
                                                        <td width="100" height="50"><a href=""><img src="~/Content/@ViewBag.a.ProductImg" style="width:100%"></a></td>
                                                        <td width="930">@ViewBag.a.ProductName</td>
                                                        <td width="100" align="center">@ViewBag.a.Price</td>
                                                        <td width="100" align="center">@ViewBag.c</td>
                                                        <td width="100" align="center"><span style="color: #e4393c;"> @ViewBag.a.Price  </span></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="checkout-count clearfix" style="border: none;">
                                        <div class="checkout-count-extend xm-add-buy">
                                            <h3 class="title" style="border: none;font-weight:bold;color: #666666;">会员留言</h3><br>
                                            <input type="text" name="" style="border: solid 1px #d2d2d2">

                                        </div>
                                        <!-- checkout-count-extend -->
                                        <div class="checkout-price">
                                            <ul>

                                                <li>
                                                    订单总额：<span>@ViewBag.a.Price</span>
                                                </li>
                                            </ul>
                                            <p class="checkout-total">应付总额：<span>@ViewBag.a.Price 元</span></p>
                                        </div>
                                        <!--  -->
                                    </div>
                                </div>
                            </div>


                        </div>
                        <!-- 商品清单 END -->

                        <div class="checkout-confirm">
                            <span>
                                <a href="cart.html" class="btn-back-cart">返回购物车</a>

                                @*<a id="btn" class="btn-primary">立即下单</a>*@
                            </span>

                        </div>
                    </div>
                </form>
                <form action="/ZhiFu/Index" method="post">
                    <input type="hidden" value="@ViewBag.a.Id" id="ProductId1" name="ProductId1" />
                    <input type="hidden" value="@ViewBag.a.ProductName" id="ProductName" name="ProductName" />
                    <input type="hidden" value="@ViewBag.a.Price" id="ToPrice" name="ToPrice" />
                    <input type="hidden" value="@ViewBag.a.ProductImg" id="ProductPrth" name="ProductPrth" />
                    <input type="hidden" value="@ViewBag.c" id="Count" name="Count" />
                    <input type="hidden" value="@ViewBag.a.Price " id="Price" name="Price" />
                    <input type="hidden" value="@ViewBag.b" id="CustId" name="CustId" />
                    <input type="hidden" value="张三" id="CustName" name="CustName" />
                    <input type="hidden" value="" id="OrderId" name="OrderId" />
                    <input type="hidden" value="张三" id="ShouName" name="ShouName" />
                    @*<input type="hidden" value="@Model.Province" id="Province" name="Province" />
                        <input type="hidden" value="@Model.City" id="City" name="City" />
                        <input type="hidden" value="@Model.District" id="District" name="District" />
                        <input type="hidden" value="@Model.Information" id="Information" name="Information" />*@
                    <input type="hidden" value="未支付" id="IsTake" name="IsTake" />
                    <input type="hidden" id="OrderTime" name="OrderTime" value="111" />
                    <input type="submit" value="立即下单" />
                </form>
            </div>
        </div>


    </div>

</div>
<script src="~/Content/js/base.min.js"></script>
<script src="~/Content/js/address_all.js"></script>
<script src="~/Content/js/checkout.min.js"></script>
<script type="text/javascript">
    var checkoutConfig = {
        addressMatch: 'common',
        addressMatchVarName: 'data',
        hasPresales: false,
        hasBigTv: false,
        hasAir: false,
        hasScales: false,
        hasGiftcard: false,
        totalPrice: 244.00,
        postage: 10,//运费
        postFree: true,//活动是否免邮了
        bcPrice: 150,//计算界值
        activityDiscountMoney: 0.00,//活动优惠
        showCouponBox: 0,
        invoice: {
            NA: "0",
            personal: "1",
            company: "2",
            electronic: "4"
        }
    };
    var miniCartDisable = true;
</script>


<script>

    $("#btn").click(function () {
        var ProductName = $("#ProductName").val();
        var Price = $("#Price").val();
        var ProductPrth = $("#PrductImg").val();
        var Productid = $("#ProductId").val();
        var CustId = $("#CustId").val();
        var Count = $("#Count").val();
        var OrderTime = $("#OrderTime").val();
        var OrderId = $("#OrderId").val();
        var State = $("#State").val();
        var IsTake = $("#IsTake").val();
        var IsFah = $("#IsFah").val();
        $.post("/ZhiFu/Index", {
            ProductName: ProductName,
            Price: Price,
            ProductPrth: ProductPrth,
            Productid: Productid,
            CustId: CustId,
            Count: Count,
            OrderTime: OrderTime,
            IsTake: IsTake,
            OrderId: OrderId,
            State: State,
            IsFah: IsFah
        }, function (res) {
            if (res.Success) {
                window.location.href = "/Order/Index";
            }

        }, 'json')


    })

</script>

<script>
    var myDate = new Date();
    myDate.getTime();        //获取当前时间(从1970.1.1开始的毫秒数)
    myDate.getHours();       //获取当前小时数(0-23)
    myDate.getMinutes();     //获取当前分钟数(0-59)
    myDate.getSeconds();     //获取当前秒数(0-59)
    myDate.getMilliseconds();    //获取当前毫秒数(0-999)
    var yyyy = myDate.toLocaleDateString();     //获取当前日期

    $("#OrderTime").val(yyyy);

</script>
<script>
    var myDate = new Date();
    var yyyy = myDate.getTime();        //获取当前时间(从1970.1.1开始的毫秒数)
    myDate.getHours();       //获取当前小时数(0-23)
    myDate.getMinutes();     //获取当前分钟数(0-59)
    myDate.getSeconds();     //获取当前秒数(0-59)
    myDate.getMilliseconds();    //获取当前毫秒数(0-999)
    myDate.toLocaleDateString();     //获取当前日期

    $("#OrderId").val(yyyy);

</script>